package com.yb.auth.core.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.Set;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/11/13 21:19
 * FileName: AuthIgnoreUrl
 * Description:
 */

@Component
@Data
@ConfigurationProperties(prefix = "security.ignore")
public class AuthIgnore implements InitializingBean{

    private Set<String> urls;

    @Override
    public void afterPropertiesSet() throws Exception {
//        urls.add("/user/login");//添加登陆接口，permitAll
        urls=urls==null?new HashSet<>():urls;
        urls.add("/user/login/**");
    }
}
